//
//  JEHRootModel.m
//  SinaNews
//
//  Created by 蒋恩浩 on 15/12/1.
//  Copyright © 2015年 JEH. All rights reserved.
//

#import "JEHRootModel.h"

@implementation JEHRootModel

- (void)dealloc
{
    [_title release];
    [_link release];
    [_kpic release];
    [_intro release];
    [_category release];
    [_commentModel release];
    [_miaoCheModel release];
    [_recommendsModel release];
    [_videoModel release];
    [_picsModel release];
    [super dealloc];
}

- (instancetype)initWithDictionary:(NSDictionary *)dictionary {
    
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}

- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"id"]) {
        self.ids = value;
    }
    if ([key isEqualToString:@"video_info"]) {
        self.videoModel = [[JEHVideoModel alloc] initWithDictionary:value];
        [_videoModel release];
    }
    if ([key isEqualToString:@"recommends"]) {
        self.recommendsModel = [[JEHRecommendsModel alloc] initWithDictionary:value];
        [_recommendsModel release];
    }
    if ([key isEqualToString:@"comment_count_info"]) {
        self.commentModel = [[JEHCommentModel alloc] initWithDictionary:value];
        [_commentModel release];
    }
    if ([key isEqualToString:@"pics"]) {
        self.picsModel = [[JEHPicsModel alloc] initWithDictionary:value];
        [_picsModel release];
    }
    if ([key isEqualToString:@"miaoche_info"]) {
        self.miaoCheModel = [[JEHMiaoCheModel alloc] initWithDictionary:value];
        [_miaoCheModel release];
    }
}

@end
